/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.championship;

import br.com.models.ClassRoom;
import br.com.models.Teacher;
import java.util.ArrayList;

/**
 *
 * @author Valdigleis
 */
public class ResultDay {

    private ArrayList<ClassRoom> periodOne;
    private ArrayList<ClassRoom> periodTwo;
    private ArrayList<ClassRoom> periodTree;
    private ArrayList<ClassRoom> periodFour;
    private ArrayList<ClassRoom> periodFive;
    private ArrayList<ClassRoom> periodSix;
    private ArrayList<ClassRoom> periodSeven;
    private ArrayList<ClassRoom> periodEight;

    public ResultDay() {
        this.periodOne = new ArrayList<ClassRoom>();
        this.periodTwo = new ArrayList<ClassRoom>();
        this.periodTree = new ArrayList<ClassRoom>();
        this.periodFour = new ArrayList<ClassRoom>();
        this.periodFive = new ArrayList<ClassRoom>();
        this.periodSix = new ArrayList<ClassRoom>();
        this.periodSeven = new ArrayList<ClassRoom>();
        this.periodEight = new ArrayList<ClassRoom>();
    }
    
    public void inster(int period, ClassRoom classRoom){
        if(period == 1){
            this.periodOne.add(classRoom);
        }else{
            if(period == 2){
                this.periodTwo.add(classRoom);
            }else{
                if(period == 3){
                    this.periodTree.add(classRoom);
                }else{
                    if(period == 4){
                        this.periodFour.add(classRoom);
                    }else{
                        if(period == 5){
                            this.periodFive.add(classRoom);
                        }else{
                            if(period == 6){
                                this.periodSix.add(classRoom);
                            }else{
                                if(period == 7){
                                    this.periodSeven.add(classRoom);
                                }else{
                                    this.periodEight.add(classRoom);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    
    public boolean checkTeacher(int sem, int horare, Teacher teacher){
        if(sem == 1){
            return (this.periodOne.get(horare).getTeacher().getId() == teacher.getId());
        }else{
            if(sem == 2){
                return (this.periodTwo.get(horare).getTeacher().getId() == teacher.getId());
            }else{
                if(sem == 3){
                    return (this.periodTree.get(horare).getTeacher().getId() == teacher.getId());
                }else{
                    if(sem == 4){
                        return (this.periodFour.get(horare).getTeacher().getId() == teacher.getId());
                    }else{
                        if(sem == 5){
                            return (this.periodFive.get(horare).getTeacher().getId() == teacher.getId());
                        }else{
                            if(sem == 6){
                                return (this.periodSix.get(horare).getTeacher().getId() == teacher.getId());
                            }else{
                                if(sem == 7){
                                    return (this.periodSeven.get(horare).getTeacher().getId() == teacher.getId());
                                }else{
                                    return false;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public ArrayList<ClassRoom> getClassRoom1(){
        return periodOne;
    }
    
    public ArrayList<ClassRoom> getClassRoom2(){
        return periodTwo;
    }
    
    public ArrayList<ClassRoom> getClassRoom3(){
        return periodTree;
    }
    
    public ArrayList<ClassRoom> getClassRoom4(){
        return periodFour;
    }
    
    public ArrayList<ClassRoom> getClassRoom5(){
        return periodFive;
    }
    
    public ArrayList<ClassRoom> getClassRoom6(){
        return periodSix;
    }
    
    public ArrayList<ClassRoom> getClassRoom7(){
        return periodSeven;
    }
    
    public ArrayList<ClassRoom> getClassRoom8(){
        return periodEight;
    }
}
